import java.util.Scanner;
class Person{
	private String name;
	private int age;
	private boolean gender;
	private int id;
	Person(){
		System.out.println("This is constructor");
		System.out.printf("%s,%d,%b,%d\n",name,age,gender,id);
	}
	public Person(String a,int b,boolean c){
		name=a;
		age=b;
		gender=c;
	}
	public String toString(){
		String className=this.getClass().getName();	
		return (className+" [name="+name+", age="+age+", gender="+gender+", id="+id+"]");
	}

	public void setname(String name){
		this.name=name;
	}
	public String getname(){
		return name;
	}
	public void setage(int age){
		this.age=age;
	}
	public int getage(){
		return age;
	}
	public void setgender(boolean gender){
		this.gender=gender;
	}
	public boolean getgender(){
		return gender;
	}	
	public void setid(int id){
		this.id=id;
	}
	public int getid(){
		return id;
	}
}
public class Main{
	public static void main(String[] args){
		Scanner read=new Scanner(System.in);
		int n=read.nextInt();	
		int i;				
		Person[] personS;		
		personS=new Person[n];	
   read.nextLine();	
		for (i=0;i<n;i++){	
			String readLine=read.nextLine();		
			String data[]=readLine.split(" ");		
			personS[i]=new Person(data[0],Integer.valueOf(data[1]),Boolean.parseBoolean(data[2]));
		}
		for (i=n-1;i>=0;i--){	
			System.out.println(personS[i].toString());
		}
		Person personNone=new Person();		
		System.out.println(personNone.toString());
	}
}